<?php
// +----------------------------------------------------------------------
// | OpenCMF [ Simple Efficient Excellent ]
// +----------------------------------------------------------------------
// | Copyright (c) 2014 http://www.opencmf.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: 廖权名  1528490339@qq.com
// +----------------------------------------------------------------------
namespace Yiban\Model;
use Think\Model;
/**
 * 项目模型
 * @author 廖权名  1528490339@qq.com
 */
class JobsModel extends Model {
    /**
     * 数据库表名
     * @author 廖权名  1528490339@qq.com
     */
    protected $tableName = 'yiban_jobs';

    /**
     * 自动验证规则
     * @author 廖权名  1528490339@qq.com
     */
    protected $_validate = array(
        // 验证新闻
        array('title', 'require', '请填写新闻标题', self::MUST_VALIDATE, 'regex', self::MODEL_BOTH),
        array('title', '3,100', '新闻标题长度为1-100个字符', self::MUST_VALIDATE, 'length', self::MODEL_BOTH),

        array('url', 'require', '请填写url地址', self::MUST_VALIDATE, 'regex', self::MODEL_BOTH),
        array('url', '3,500', 'url地址长度为1-500个字符', self::MUST_VALIDATE, 'length', self::MODEL_BOTH),
        //array('url', '/[a-zA-z]+://[^\s]*/', 'url地址错误！', self::MUST_VALIDATE, 'regex', self::MODEL_BOTH),


    );

    /**
     * 自动完成规则
     * @author 廖权名  1528490339@qq.com
     */
    protected $_auto = array(
        array('sort', '0', self::MODEL_BOTH),
        array('create_time', 'time', self::MODEL_BOTH, 'function'),
        array('status', '1', self::MODEL_BOTH),
    );


}
